//Classe que monta a tela  de login

import javax.swing.*;
public class Flogin extends javax.swing.JFrame {
 
public Flogin() {
        initComponents();
    }
 
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
 
        pDados = new javax.swing.JPanel();
        lNome = new javax.swing.JLabel();
        tNome = new javax.swing.JTextField();
        lSenha = new javax.swing.JLabel();
        tSenha = new javax.swing.JPasswordField();
        bOK = new javax.swing.JButton();
        bCancelar = new javax.swing.JButton();
 
        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Login");
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
 
        pDados.setBorder(javax.swing.BorderFactory.createTitledBorder("LOGIN"));
        pDados.setToolTipText("");
        lNome.setText("Nome:");
        lSenha.setText("Senha:");
 
        javax.swing.GroupLayout pDadosLayout = new javax.swing.GroupLayout(pDados);
        pDados.setLayout(pDadosLayout);
        pDadosLayout.setHorizontalGroup(
        pDadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            
            	.addGroup(pDadosLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pDadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(lNome)
                .addComponent(tNome, javax.swing.GroupLayout.PREFERRED_SIZE, 227, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(lSenha)
                .addComponent(tSenha, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
        		                        		
        	pDadosLayout.setVerticalGroup(
            pDadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            
                .addGroup(pDadosLayout.createSequentialGroup()           		
                .addComponent(lNome)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(tNome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(lSenha)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(tSenha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(51, Short.MAX_VALUE)));
        	
        	
        bOK.setText("OK");
        bOK.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        bOK.addMouseListener(new java.awt.event.MouseAdapter() {
        	
public void mouseClicked(java.awt.event.MouseEvent evt) {
                bOKMouseClicked(evt);
            }
        });
 
        bCancelar.setText("Cancelar");
        bCancelar.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        bCancelar.addMouseListener(new java.awt.event.MouseAdapter() {
        	
 public void mouseClicked(java.awt.event.MouseEvent evt) {
                bCancelarMouseClicked(evt);
            }
        });
 
        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
        		
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            
            .addComponent(pDados, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addContainerGap())
                
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
            .addContainerGap(41, Short.MAX_VALUE)
            
            .addComponent(bOK, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addGap(18, 18, 18)
            
            .addComponent(bCancelar, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addGap(48, 48, 48)));
        
        layout.setVerticalGroup(
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        
                .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                
                .addComponent(pDados, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                		
                .addComponent(bOK, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE)
                
                .addComponent(bCancelar, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
                pack();
       }
    
    // </editor-fold>//GEN-END:initComponents
 
    private void bOKMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_bOKMouseClicked
        JOptionPane.showMessageDialog(null, "      Bem Vindo:  "+ tNome.getText() +"\n"+ "      Login Realizado ");
        
        System.exit(0);
    }
    
    //GEN-LAST:event_bOKMouseClicked
 
    private void bCancelarMouseClicked(java.awt.event.MouseEvent evt) {    	
    
    	//GEN-FIRST:event_bCancelarMouseClicked
        System.exit(0);
    }
    //GEN-LAST:event_bCancelarMouseClicked
    // Variables declaration - do not modify//GEN-BEGIN:variables
    
    private javax.swing.JButton bCancelar;
    private javax.swing.JButton bOK;
    private javax.swing.JLabel lNome;
    private javax.swing.JLabel lSenha;
    private javax.swing.JPanel pDados;
    private javax.swing.JTextField tNome;
    private javax.swing.JPasswordField tSenha;
    
    // End of variables declaration//GEN-END:variables
      
}
	
